﻿using MengLin.OOP.DesignPattern.Proxy.AOP.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.Proxy.AOP
{
    class Program
    {
        static void Main(string[] args)
        {
            User user = new User()
            {
                Name = "张三"
            };
            #region 原来的上端调用
            {
                {
                    IUserService userService = new WomanUserService();
                    userService.RegUser(user);
                }
                {
                    IUserService userService = new ManUserService();
                    userService.RegUser(user);
                }
            }
            #endregion

            #region 改成代理后上端的调用
            {
                UserServiceProxy userServiceProxy = new UserServiceProxy();
                userServiceProxy.RegUser(user);
            }
            #endregion
        }
    }
}
